package com.study.entity.lock;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @description 账户信息
 * @author hw
 * @date 2023/6/16 16:30:05
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class Account {

    /**
     * 账户名称
     */
    private String accountName;

    /**
     * 余额
     */
    private int balance;

    /**
     * 取钱
     */
    public void debit(int amount){
        this.balance-=amount;
    }

    /**
     * 存钱
     */
    public void credit(int amount){
        this.balance+=amount;
    }
}
